﻿
#include <windows.h>
#include <osgViewer/Viewer>
#include <osgDB/ReadFile>

int main()
{
	osgDB::Registry::instance()->addFileExtensionAlias("fs", "fs");//将文件扩展名与dll名关联起来


	osg::ref_ptr<osg::Node> node = new osg::Node;
	node = osgDB::readNodeFile("sphere.fs");


	osg::ref_ptr<osgViewer::Viewer> viewer = new osgViewer::Viewer;
	viewer->setUpViewInWindow(100, 100, 1500, 1000);
	viewer->setSceneData(node.get());

	osgDB::Registry::instance()->writeNode(*(node.get()), "D:\\test.fs", osgDB::Registry::instance()->getOptions());
	
	return viewer->run();
}